package com.hd.trans.framework.languages;

import android.view.View;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.entity.node.BaseNode;
import com.chad.library.adapter.base.provider.BaseNodeProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.hd.trans.R;
import com.hd.trans.common.Constants;
import com.hd.trans.db.bean.HuDunLanguage;

import org.greenrobot.greendao.annotation.NotNull;

/**
 * Author:  yang
 * Date:    2020/01/07 18:11
 * Desc:    类作用描述
 */
public class RootFooterNodeProvider extends BaseNodeProvider {


    @Override
    public int getItemViewType() {
        return Constants.LevelType.FOOT;
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_foot;
    }

    @Override
    public void convert(@NotNull BaseViewHolder helper, @Nullable BaseNode data) {
        // 数据类型需要自己强转
//        final HuDunLanguage child = (HuDunLanguage) data;
//        if (child != null) {
//            helper.setText(R.id.tv_name, child.getName());
//            if (getAdapter() instanceof LanguageDialogAdapter) {
//                LanguageDialogAdapter adapter = (LanguageDialogAdapter) getAdapter();
////                helper.setVisible(R.id.iv_check, child.equals(adapter.getCheckedItem()));
//            }
//        }
    }

    @Override
    public void onClick(@NotNull BaseViewHolder helper, @NotNull View view, BaseNode data, int position) {
//        getAdapter().expandOrCollapse(position);
//        final HuDunLanguage child = (HuDunLanguage) data;
//        if (child != null) {
//            if (getAdapter() instanceof LanguageDialogAdapter) {
//                LanguageDialogAdapter adapter = (LanguageDialogAdapter) getAdapter();
//                adapter.setCheckedItem(child);
//            }
//        }
    }
}